import { _decorator, Component, Node, SkeletalAnimation } from 'cc';
import { PathMove } from '../PlayableFramework/Tools/Path/PathMove';
import { PoolObject } from '../PlayableFramework/Tools/Pool/PoolObject';
import { PROGRESSBAR } from '../../extensions/plugin-import-2x/creator/components/ProgressBar';
const { ccclass, property } = _decorator;

@ccclass('Guest')
export class Guest extends PoolObject {
    
    public anim:SkeletalAnimation
    public mover:PathMove;
    
    @property(Node)
    public bike:Node;

    protected onLoad(): void {
        this.anim = this.getComponentInChildren(SkeletalAnimation);
        this.mover = this.getComponent(PathMove);
    }

    
    start() {
        //this.bike.active = false;
        this.anim.play("idle_bike");
    }

    update(deltaTime: number) {
        
        
    }

    public ride(){
        this.bike.active = true;
        this.anim.play("ride_bike");
    }
}


